import 'package:base_plugin/base_plugin.dart';
import 'package:dio/dio.dart';

/// 用户设置相关
class HttpStatementOfAccountService {
  /// 获取设置数据
  static Future<Response> getPaymentInstruction(int id) {
    return BaseConfig.httpBase.get('/api/statementofaccount/$id', {});
  }

  static Future<Response> downloadSOA(
      String filePath, int id, String paymentInstruction, String additionalNote,
      [CancelToken cancelToken, ProgressCallback onReceiveProgress]) {
    return BaseConfig.httpBase.download(
        '/api/statementofaccount/$id',
        filePath,
        {
          "payment_instruction": paymentInstruction,
          "additional_note": additionalNote,
          "is_pdf": 1
        },
        cancelToken,
        onReceiveProgress,
        Options(method: "POST"));
  }
}
